<template>
	<view class="page">
		<!-- <u-navbar bgColor='#4871C0' :titleStyle="{ color: '#FFF'}" title="编辑内容" leftIconColor="#FFF" :autoBack="true">
		</u-navbar> -->
		<u-textarea class="textarea" placeholder="请输入议题顺序" v-model="content"  height="160" auto-height confirmType="return">
		</u-textarea>
		<u-button class="btn" text="保存" type="primary" color="#4871C0" @click="save"></u-button>
	</view>
</template>

<script>
	import {
		setSort,
		sortDetail
	} from '@/api/meetApi.js'
	import UButton from "@/uni_modules/uview-ui/components/u-button/u-button";
	import UTextarea from "@/uni_modules/uview-ui/components/u--textarea/u--textarea";
	export default {
		name: "metting-sort-edit",
		components: {
			UTextarea,
			UButton
		},
		data() {
			return {
				content: '',
				isLoading:false,
				id:''
			}
		},
		onLoad(options) {
			this.id = options.id;
		},
		onShow() {
			this.getsortDetail()
		},
		methods: {
			getsortDetail(){
				this.isLoading = true;
				sortDetail({meet_id:this.id}).then(res => {
					this.content = res.data.set_sort;
				})
			},
			save() {
				this.isLoading = true;
				let params={
					meet_id:this.id,
					set_sort:this.content
				}
				setSort(params).then(res => {
					this.isLoading = false;
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 1000
					});
					if (res.code == 1) {
						var that = this;
						setTimeout(function() {
							uni.navigateBack()
						}, 2000);

					}
				})

			}
		}
	}
</script>

<style lang="scss" scoped>
	$font-color: #4871c0;

	.page {
		height: 90vh;
		background: #F8F8F8;

		.textarea {
			background-color: #FFFFFF;
			// margin-top: 44px;
			min-height: 160px;
		}

		.btn {
			position: absolute;
			width: 90%;
			bottom: 10px;
			left: 20px;
		}
	}
</style>
